﻿package cn.edu.zjusc.Webservice;

import java.util.List;

import javax.ejb.Stateless;
import javax.jws.*;
import javax.jws.soap.SOAPBinding;
import javax.persistence.*;


import org.jboss.wsf.spi.annotation.WebContext;

import cn.edu.zjusc.POJO.*;

@Stateless
@WebService(name = "StudentBaseInfoService", serviceName = "StudentBaseInfoService")
@SOAPBinding(style = SOAPBinding.Style.RPC)
@WebContext(contextRoot = "/ZJUSCIX/Service", urlPattern = "/StudentBaseInfoService")
public class StudentBaseInfoService {

	/**
	 * 暂且不知道做什么，待斟酌
	 * @param id
	 * @return
	 */
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public List<StudentBaseInfo> GetStudentBaseInfoById(	//GetStudentBaseInfoById	GetStudentBaseInfoByExamId
			@WebParam(name = "id") String id) {

		EntityManagerFactory emf = Persistence
				.createEntityManagerFactory("zjusc");
		EntityManager em = emf.createEntityManager();
		//stubs_id
//		Query query = em
//		.createQuery("select s from StudentBaseInfo s,StudentExtendInfo e where s.stubs_id=e.stuext_id and e.stuext_examCardID ='"
//				+ id+"'");
		Query query = em
				.createQuery("select s from StudentBaseInfo s where s.stubs_id ='"
						+ id+"'");
		
		List stuExtendBkList = query.getResultList();

		em.close();
		emf.close();
		return stuExtendBkList;
	}



}
